﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Models;
using DAL;
using System.Data;

namespace BLL
{
   public class OrderBLL
    {
        /// <summary>
        /// 订单
        /// </summary>
        //订单添加
        public static bool orderAdd(Order o) {
            return OrderDAL.orderAdd(o) > 0;
        }
        //有订单编号查询订单id
        public static object orderIDBLL(string bh) {
            return OrderDAL.orderID(bh);
        }
        //订单支付
        public static bool orderPayBLL(string bh) {
            return OrderDAL.orderPay(bh)>0;
        }
        //后台订单查询
        public static DataTable orderCXBLL() {
            return OrderDAL.orderCX();
        }
        //订单发货判断是否支付
        public static object ddSfzfBLL(int id) {
            return OrderDAL.ddSfzf(id);
        }
        //订单发货
        public static bool orderGoodsBLL(int id) {
            return OrderDAL.orderGoods(id)>0;
        }
        //确认订单是否收货
        public static object orderSFSHBLL(int id) {
            return OrderDAL.orderSFSH(id);
        }
        //订单收货
        public static bool receiveGoodsBLL(int id) {
            return OrderDAL.receiveGoods(id) > 0;
        }
        //查询数据条数
        public static object dataNumBLL() {
            return OrderDAL.dataNum();
        }
        //查询总金额
        public static object sumBLL() {
            return OrderDAL.sum();
        }
        //后台订单详细查询
        public static DataTable orderDetailedBLL(int id) {
            return OrderDAL.orderDetailed(id);
        }
        //根据不同的订单要求模糊查询
        public static DataTable orderMHBLL(string sq) {
            return OrderDAL.orderMH(sq);
        }
        //前台我的订单查看
        public static DataTable orderQTBLL(int id) {
            return OrderDAL.orderQT(id);
        }
        //前台订单删除
        public static bool orderDeleteBLL(int id) {
            return OrderDAL.orderDelete(id)>0;
        }
        //查询是否收货
        public static object orderSHBLL(string id) {
            return OrderDAL.orderSH(id);
        }
    }
}
